#include "system.h"  
#include "systick.h"
#include "usart.h"
#include "oled.h"
#include "servo.h"
#include "timer.h"
#include "key.h"


int main(void)
{		
	NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
	OLED_Init();
	usart_init(9600);
	key_init();
	servo_init();
	TIM_SetCompare1(TIM8,1500);
	TIM_SetCompare3(TIM8,1450);
	while((ball.cx==0)||(ball.cy==0));
	TIM_ITConfig(TIM8,TIM_IT_Update,ENABLE);
	while(1)
	{
		key_scan();
		OLED_Print(1,1,"cx:%6d",ball.cx);
		OLED_Print(2,1,"cy:%6d",ball.cy);
	} 
}

























/*
 *                        _oo0oo_
 *                       o8888888o
 *                       88" . "88
 *                       (| -_- |)
 *                       0\  =  /0
 *                     ___/`---'\___
 *                   .' \\|     |// '.
 *                  / \\|||  :  |||// \
 *                 / _||||| -:- |||||- \
 *                |   | \\\  - /// |   |
 *                | \_|  ''\---/''  |_/ |
 *                \  .-\__  '-'  ___/-. /
 *              ___'. .'  /--.--\  `. .'___
 *           ."" '<  `.___\_<|>_/___.' >' "".
 *          | | :  `- \`.;`\ _ /`;.`/ - ` : | |
 *          \  \ `_.   \_ __\ /__ _/   .-` /  /
 *      =====`-.____`.___ \_____/___.-`___.-'=====
 *                        `=---='
 */


